<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>部署Code-server以及C++，Go语言的环境配置 | magic-H</title><meta name="keywords" content="技术"><meta name="author" content="magic-H"><meta name="copyright" content="magic-H"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="简介​    本人是iPad党，实在不想感受游戏本的重量，但是又要用到C++，Go语言开发，于是想起了GitHub上Code-server的项目，正巧有 白嫖了 个服务器，所以就开始干了！ ​    安装包准备：  Code-server   Xshell 命令行工具  Go语言环境  服务器是Centos 7的系统   部署Code-server到服务器1. 服务器安装宝塔 在Xshell 中输">
<meta property="og:type" content="article">
<meta property="og:title" content="部署Code-server以及C++，Go语言的环境配置">
<meta property="og:url" content="http://example.com/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/index.html">
<meta property="og:site_name" content="magic-H">
<meta property="og:description" content="简介​    本人是iPad党，实在不想感受游戏本的重量，但是又要用到C++，Go语言开发，于是想起了GitHub上Code-server的项目，正巧有 白嫖了 个服务器，所以就开始干了！ ​    安装包准备：  Code-server   Xshell 命令行工具  Go语言环境  服务器是Centos 7的系统   部署Code-server到服务器1. 服务器安装宝塔 在Xshell 中输">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://s4.ax1x.com/2022/02/24/bkZVAA.png">
<meta property="article:published_time" content="2022-02-23T16:00:00.000Z">
<meta property="article:modified_time" content="2022-03-08T00:32:40.000Z">
<meta property="article:author" content="magic-H">
<meta property="article:tag" content="技术">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://s4.ax1x.com/2022/02/24/bkZVAA.png"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://example.com/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'mediumZoom',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '部署Code-server以及C++，Go语言的环境配置',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-03-08 08:32:40'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/mycss.css"><script src="/js/sakura.js"></script><script src="/js/snow2.js"></script><meta name="generator" content="Hexo 6.0.0"><link rel="alternate" href="/atom.xml" title="magic-H" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://s4.ax1x.com/2022/02/18/HT4dgI.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">3</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/questions/"><i class="fa-fw fa fa-video"></i><span> 答疑</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw fa fa-home"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间线</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://s4.ax1x.com/2022/02/19/HHwzEq.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">magic-H</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/questions/"><i class="fa-fw fa fa-video"></i><span> 答疑</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw fa fa-home"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间线</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">部署Code-server以及C++，Go语言的环境配置</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-02-23T16:00:00.000Z" title="发表于 2022-02-24 00:00:00">2022-02-24</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-03-08T00:32:40.000Z" title="更新于 2022-03-08 08:32:40">2022-03-08</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">772</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>2分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="部署Code-server以及C++，Go语言的环境配置"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h1><p>​    本人是iPad党，实在不想感受游戏本的重量，但是又要用到C++，Go语言开发，于是想起了GitHub上Code-server的项目，正巧有 <del>白嫖了</del> 个服务器，所以就开始干了！</p>
<p>​    安装包准备：</p>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://1239392085-my.sharepoint.com/:u:/g/personal/magic-h_1239392085_onmicrosoft_com/EZMHct9RP7FHtyHvmnbRPdsBgfhPoSnO4ZyHYdnqOfLyvw?e=L8tRmr">Code-server</a> </p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://www.aliyundrive.com/s/zHRJtHZx3pE">Xshell</a> 命令行工具</p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://1239392085-my.sharepoint.com/:u:/g/personal/magic-h_1239392085_onmicrosoft_com/EXwUMOJXcohMsU-Sl7_uU5QBHz2zTCH6Ibn7iUh3z8tLVQ?e=I8RXm5">Go语言环境</a></p>
</li>
<li><p>服务器是Centos 7的系统</p>
</li>
</ul>
<h1 id="部署Code-server到服务器"><a href="#部署Code-server到服务器" class="headerlink" title="部署Code-server到服务器"></a>部署Code-server到服务器</h1><h2 id="1-服务器安装宝塔"><a href="#1-服务器安装宝塔" class="headerlink" title="1. 服务器安装宝塔"></a>1. 服务器安装宝塔</h2><ol>
<li><p>在Xshell 中输入以下命令（适用于Centos 7）</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install -y wget &amp;&amp; wget -O install.sh http://download.bt.cn/install/install_6.0.sh &amp;&amp; sh install.sh</span><br></pre></td></tr></table></figure>

<p>其它的系统可以在 <a target="_blank" rel="noopener" href="https://www.bt.cn/">宝塔</a> 官网获取支持，例如：</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061620346.png" alt="image-2022022421052286"></p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061620999.png" alt="image-2022022421063612"></p>
<p>途中会有一次确认安装，请输入 <strong>y</strong> 。</p>
</li>
<li><p>登录宝塔</p>
<p>在安装完成后我们获得了宝塔的各种消息，在浏览器中登录外网地址，使用账号密码登录</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061620673.png" alt="image-2022022421114387"></p>
</li>
</ol>
<h2 id="2-安装Code-server"><a href="#2-安装Code-server" class="headerlink" title="2. 安装Code-server"></a>2. 安装Code-server</h2><ol>
<li><p>使用宝塔上传Code-server安装包</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061620402.png" alt="image-2022022421167873"></p>
<p>打开<strong>opt</strong>文件夹（图中的文件夹是我已经解压的文件夹）</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061620578.png" alt="image-20220224211751818"></p>
<p>选择上传</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061621603.png" alt="image-20220224211848168"></p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061621400.png" alt="image-20220224212033225"></p>
<p>解压Code-server文件</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622987.png" alt="image-20220224212118860"></p>
<p>在Xshell中运行下列命令后使用 <strong>Ctrl+C</strong>退出</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./bin/code-server</span><br></pre></td></tr></table></figure>


</li>
<li><p>配置Code-server</p>
<p>地址栏中输入：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/root/.config/code-server</span><br></pre></td></tr></table></figure>



<p><img src="https://raw.githubusercontent.com/magic-H728/Store/master/CNtwiyncHfGxlMO.png" alt="image-20220224212710312"></p>
<p>双击编辑 <strong>config.yaml</strong>文件</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622743.png" alt="image-20220224212837196"></p>
<p>图中的<strong>bind-addr</strong>使用的是8848端口，因为8080端口经常被占，尽量不要选择8080端口</p>
<p>password密码可以自己设置，建议都先按照我的设置。</p>
</li>
<li><p>打开8848端口</p>
<p>打开你的服务器，设置安全住规则，比如我的是阿里云：</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622241.png" alt="image-20220224213414599"></p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622861.png" alt="image-20220224213455341"></p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622128.png" alt="image-20220224213559198"></p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622178.png" alt="image-20220224213709369"></p>
<p>宝塔的配置</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061622598.png"></p>
</li>
<li><p>启动Code-server</p>
<p>在Xshell中输入以下命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./bin/code-server</span><br></pre></td></tr></table></figure>

<p>此时可以使用你的<strong>公网IP+ :8080</strong>访问到你的Code-server，使用Ctrl+C可以退出</p>
</li>
<li><p>让Code-server在后台长时间运行（建议先将访问密码修改，否则后面修改有点麻烦）</p>
<p>在Xshell输入下面命令安装screen</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install screen</span><br></pre></td></tr></table></figure>

<p>在Xshell输入下面命令新建screen回话</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">screen -S codeserver</span><br></pre></td></tr></table></figure>

<p>在Xshell输入下面命令启动Code-server</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./bin/code-server</span><br></pre></td></tr></table></figure>

<p>接下来关闭Xshell即可，~~~完结撒花！！！~~</p>
</li>
</ol>
<hr>
<h1 id="配置开发环境"><a href="#配置开发环境" class="headerlink" title="配置开发环境"></a>配置开发环境</h1><h2 id="1-配置C-开发语言环境"><a href="#1-配置C-开发语言环境" class="headerlink" title="1. 配置C++开发语言环境"></a>1. 配置C++开发语言环境</h2><ol>
<li><p>在Xshell中输入下列命令安装gcc</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install gcc</span><br></pre></td></tr></table></figure>
</li>
<li><p>在Xshell中输入下列命令验证是否安装成功</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gcc --version</span><br></pre></td></tr></table></figure>

<p>如果出现了版本号则成功安装</p>
<p> <del>这tm比Windows方便多了</del></p>
</li>
</ol>
<h2 id="2-配置Go语言开发环境"><a href="#2-配置Go语言开发环境" class="headerlink" title="2. 配置Go语言开发环境"></a>2. 配置Go语言开发环境</h2><ol>
<li><p>将下载的go语言开发包上传到服务器</p>
<p>地址栏中输入&#x2F;usr&#x2F;local，进入目录后选择上传。</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061623098.png" alt="image-20220224222908917"></p>
<p><strong>图中的文件选择解压</strong></p>
</li>
<li><p>配置环境变量</p>
<p>进入地址栏中的目录，找到profile文件，双击编辑</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061619556.png" alt="image-20220224223049987"></p>
<p>文件中输入 export PATH&#x3D;$PATH:&#x2F;usr&#x2F;local&#x2F;go&#x2F;bin</p>
<p><img src="https://gitee.com/magic-H728/store/raw/master/master/202203061617542.png" alt="image-20220224222627783"></p>
<p>配置成功！！！<del>完结撒花！！！</del></p>
</li>
</ol>
<hr>
<h1 id="Tips："><a href="#Tips：" class="headerlink" title="Tips："></a>Tips：</h1><ul>
<li>关于VS Code的使用我就不重复了，记得各种插件安装上，还有设置中勾选Run in terminal的选项。</li>
<li>Centos 7 自带了Python的开发环境，~~~我就不需要写教程啦~~</li>
<li>遇到不会的随时<del>重置服务器</del>在下面提问！</li>
<li>程序员不要太肝了，保重身体！！！！！！</li>
</ul>
<hr>
<h1 id="完结撒花！！！"><a href="#完结撒花！！！" class="headerlink" title="完结撒花！！！"></a>完结撒花！！！</h1></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">magic-H</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/">http://example.com/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">magic-H</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E6%8A%80%E6%9C%AF/">技术</a></div><div class="post_share"><div class="social-share" data-image="https://s4.ax1x.com/2022/02/24/bkZVAA.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/2022/02/19/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/"><img class="next-cover" src="https://s4.ax1x.com/2022/02/19/HHwzEq.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">从零开始搭建个人博客</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2022/02/19/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" title="从零开始搭建个人博客"><img class="cover" src="https://s4.ax1x.com/2022/02/19/HHwzEq.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-02-19</div><div class="title">从零开始搭建个人博客</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="waline-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://s4.ax1x.com/2022/02/18/HT4dgI.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">magic-H</div><div class="author-info__description"></div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">3</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/magic-H728" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:h1239392085@outlook.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%AE%80%E4%BB%8B"><span class="toc-text">简介</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2Code-server%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-text">部署Code-server到服务器</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85%E5%AE%9D%E5%A1%94"><span class="toc-text">1. 服务器安装宝塔</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E5%AE%89%E8%A3%85Code-server"><span class="toc-text">2. 安装Code-server</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83"><span class="toc-text">配置开发环境</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E9%85%8D%E7%BD%AEC-%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80%E7%8E%AF%E5%A2%83"><span class="toc-text">1. 配置C++开发语言环境</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E9%85%8D%E7%BD%AEGo%E8%AF%AD%E8%A8%80%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83"><span class="toc-text">2. 配置Go语言开发环境</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Tips%EF%BC%9A"><span class="toc-text">Tips：</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%8C%E7%BB%93%E6%92%92%E8%8A%B1%EF%BC%81%EF%BC%81%EF%BC%81"><span class="toc-text">完结撒花！！！</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" title="部署Code-server以及C++，Go语言的环境配置"><img src="https://s4.ax1x.com/2022/02/24/bkZVAA.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="部署Code-server以及C++，Go语言的环境配置"/></a><div class="content"><a class="title" href="/2022/02/24/%E9%83%A8%E7%BD%B2Code-server%E4%BB%A5%E5%8F%8AC++%EF%BC%8CGo%E8%AF%AD%E8%A8%80%E7%9A%84%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE/" title="部署Code-server以及C++，Go语言的环境配置">部署Code-server以及C++，Go语言的环境配置</a><time datetime="2022-02-23T16:00:00.000Z" title="发表于 2022-02-24 00:00:00">2022-02-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/19/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" title="从零开始搭建个人博客"><img src="https://s4.ax1x.com/2022/02/19/HHwzEq.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="从零开始搭建个人博客"/></a><div class="content"><a class="title" href="/2022/02/19/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" title="从零开始搭建个人博客">从零开始搭建个人博客</a><time datetime="2022-02-18T16:00:00.000Z" title="发表于 2022-02-19 00:00:00">2022-02-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/17/hello-world/" title="Hello World！"><img src="https://s4.ax1x.com/2022/02/18/HT4dgI.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hello World！"/></a><div class="content"><a class="title" href="/2022/02/17/hello-world/" title="Hello World！">Hello World！</a><time datetime="2022-02-16T16:00:00.000Z" title="发表于 2022-02-17 00:00:00">2022-02-17</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://s4.ax1x.com/2022/02/19/HHwzEq.png')"><div id="footer-wrap"><div class="copyright">&copy;2022 By magic-H</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><img src="https://static.dy208.cn/o_1dfilp8ruo521thr1hvf18ji17soa.png">
<a href="http://www.beian.miit.gov.cn/"  style="color:#f72b07" target="_blank">粤ICP备2022027428号</a><div class="footer_custom_text">Hi, welcome to my <a href="magic-h.top">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function loadWaline () {
  function initWaline () {
    const waline = new Waline(Object.assign({
      el: '#waline-wrap',
      serverURL: 'https://magic-h-mr0qem8oh-magic-h728.vercel.app/',
      path: location.pathname,
      visitor: false,
      dark: 'html[data-theme="dark"]'
    }, null))
  }

  if (typeof Waline === 'function') initWaline()
  else getScript('https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js').then(initWaline)
}

if ('Waline' === 'Waline' || !false) {
  if (false) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
  else setTimeout(loadWaline, 0)
} else {
  function loadOtherComment () {
    loadWaline()
  }
}</script></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="canvas_nest" defer="defer" color="200,100,255" opacity="0.7" zIndex="-1" count="118" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = false;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"]):not([href="/music/"]):not([href="/no-pjax/"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="/%5Bobject%20Object%5D"></script></div></body></html>